<?php
/**
 * Created by PhpStorm.
 * User: yiwan
 * Date: 2018/5/16
 * Time: 11:43
 */

ini_set('display_errors', 1);
error_reporting(-1);
require_once '/data/wwwroot/g_vendor/autoload.php';

use Biz\model\ShopSecurityDepositLog;

$arr = [
    ["9", "250664", "20180504"],
    ["10", "720551", "20180502"],
    ["11", "262535", "20180507"],
    ["12", "261831", "20180507"],
    ["13", "270618", "20180508"],
    ["14", "270926", "20180508"],
    ["15", "994953-1", "20180510"],
    ["16", "279773", "20180509"],
    ["17", "285124", "20180510"],
    ["18", "925921", "20180509"],
    ["19", "280537", "20180509"],
    ["20", "286838", "20180510"],
    ["21", "281911-2", "20180509"],
    ["22", "281911-1", "20180509"],
    ["23", "286798", "20180510"],
    ["24", "286367", "20180510"],
    ["25", "286393", "20180510"],
    ["26", "286366", "20180510"],
    ["27", "287855", "20180510"],
    ["28", "288379", "20180510"],
    ["29", "988934-2", "20180510"],
    ["30", "988934-1", "20180510"],
    ["31", "296407", "20180511"],
    ["32", "297706", "20180511"],
    ["33", "298312", "20180511"],
    ["34", "300281", "20180511"],
    ["35", "300116", "20180511"],
    ["37", "299066", "20180511"],
    ["38", "300448", "20180511"],
    ["40", "301045", "20180511"],
    ["41", "302621", "20180511"],
    ["42", "302620", "20180511"],
    ["43", "297555", "20180511"],
    ["44", "305904", "20180514"],
    ["47", "62144", "20180514"],
    ["48", "313043", "20180514"],
    ["49", "312463", "20180514"],
    ["50", "313084", "20180514"],
    ["51", "305249", "20180513"],
    ["52", "317023", "20180515"],
    ["53", "320083", "20180515"],
    ["55", "994953-2", "20180510"],
    ["58", "321527-1", "20180515"],
    ["59", "321527-2", "20180515"],
    ["60", "774130", "20180517"],
    ["61", "346319", "20180518"],
    ["62", "352100", "20180518"],
    ["63", "991418", "20180522"],
    ["64", "401559", "20180525"],
    ["65", "354488", "20180518"],
    ["66", "367708", "20180522"],
    ["67", "373177", "20180522"],
    ["68", "380294", "20180523"],
    ["69", "381624", "20180523"],
    ["70", "383218", "20180523"],
    ["71", "389539", "20180524"],
    ["72", "390566", "20180524"],
    ["73", "397476", "20180525"],
    ["74", "397466", "20180525"],
    ["75", "401692", "20180525"],
    ["76", "407705", "20180528"],
    ["77", "407709", "20180528"],
    ["78", "421045", "20180529"],
];
foreach ($arr as $row) {
    $id = $row[0];
    $transNum = $row[1];
    $transTime = $row[2];
    $where = ['id' => $id, 'trans_number' => $transNum];
    $data = ['trans_time' => date('Y-m-d', strtotime($transTime))];
    if ($where && $data) {
        $ret = ShopSecurityDepositLog::update($data, $where);
        if ($ret->errorCode() !== '00000') {
            throw new \Exception('数据库操作错误:' . ShopSecurityDepositLog::log());
        }
        if ($ret->rowCount()) {
            var_dump('执行成功' . $id);
        }
    }
}


